package com.tim.app.ui.activity.person_center;

import android.support.v4.view.ViewPager;
import android.view.View;
import android.widget.ImageButton;

import com.application.library.widget.smarttab.SmartTabLayout;
import com.tim.app.R;
import com.tim.app.ui.activity.BaseActivity;
import com.tim.app.ui.adapter.TabAdapter;
import com.tim.app.ui.fragment.person.CorrectChangeFragment;
import com.tim.app.ui.fragment.person.IncomeJasmineFragment;
import com.tim.app.ui.fragment.person.InvateFriendFragment;
import com.tim.app.ui.fragment.person.MyInvateFragment;

/**
 * Created by wdy on 2017/8/22.
 */

public class IncomeDetailActivity extends BaseActivity {
    private ImageButton ibBack;
    private SmartTabLayout tab_layout;
    private ViewPager vpMyViewContent;
    private TabAdapter pageAdapter;

    @Override
    protected int getLayoutId() {
        return R.layout.activity_incomedetail;
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.ibBack:
                finish();
                break;
        }
    }

    @Override
    public void initView() {
        ibBack = (ImageButton) findViewById(R.id.ibBack);
        tab_layout = (SmartTabLayout) findViewById(R.id.tab_layout);
        vpMyViewContent = (ViewPager) findViewById(R.id.vpMyViewContent);
    }

    @Override
    public void initData() {
        ibBack.setOnClickListener(this);
        pageAdapter = new TabAdapter(getSupportFragmentManager());
        pageAdapter.addFragment(new IncomeJasmineFragment(), getString(R.string.moli));
        pageAdapter.addFragment(new CorrectChangeFragment(), getString(R.string.correct_change));
        vpMyViewContent.setOffscreenPageLimit(1);
        vpMyViewContent.setAdapter(pageAdapter);
        vpMyViewContent.setCurrentItem(0);
        tab_layout.setViewPager(vpMyViewContent);
    }
}
